<template>
	<view>
		<u-navbar :title="title1" :autoBack="false" leftIcon=" " placeholder></u-navbar>
		<view class="userinfo">
			<view class="u-flex u-flex-items-start u-flex-between">
				<view class="">
					<view class="userinfo__nickname">
						{{userinfo.username}}
					</view>
					<view class="userinfo__school">
						{{userinfo.schoolName}}
					</view>
				</view>
				<image @click="navto('/pages/my/info')" :src="URL(userinfo.avatar)" class="userinfo__tx" mode="aspectFill"></image>
			</view>
			<view class="u-flex u-flex-y-center u-flex-between" style="margin-top: 43rpx;">
				<view class="u-flex u-flex-y-center">
					<view class="" style="margin-right: 70rpx;">
						<view class="userinfo__num">
							{{userinfo.sendCount}}
						</view>
						<view class="userinfo__txt">
							已发帖
						</view>
					</view>
					<view class="">
						<view class="userinfo__num">
							{{userinfo.goodNum}}
						</view>
						<view class="userinfo__txt">
							被点赞
						</view>
					</view>
				</view>
				<view class="u-flex u-flex-y-center">
					<u-button :customStyle='{height:"56.25rpx",width:"159.38rpx",fontSize:"36rpx",color:"#3E3E3E",marginRight:"22rpx",}'
						text="校果规范" color="#FFFFFF"></u-button>
					<u-button :customStyle='{height:"56.25rpx",width:"159.38rpx",fontSize:"36rpx",color:"#FFFFFF",}'
						text="切换学校" @click="navto('/pages/my/checkschool?type=1 ')" color="#4A4A4A"></u-button>
				</view>
			</view>
		</view>
		<view class="con">
			<view class="con__title">
				我的帖子
				<image @click="navto('/pages/tabbar/msg',2)" src="/static/home/lingdang.png" class="con__title__icon" mode=""></image>
			</view>
			<view class="" style="margin-top: 104rpx;">
				<empty title="还没有发布过帖子" tip="快来以图代笔，记录你和学校的点滴吧">
					<view class="empbtn" @click="navto('/pages/tabbar/fabu')">
						前去发布
					</view>
				</empty>
			</view>
		</view>
		
		<tabbar :current="4"></tabbar>
	</view>
</template>

<script>
	import user from '@/api/_user.js'
	export default {
		data() {
			return {
				userinfo:{}
			};
		},
		onLoad() {
			uni.hideTabBar()
		},
		onShow() {
			user.userindex().then(res=>{
				if(res.data.code==1){
					this.userinfo=res.data.data.userinfo
					uni.setStorageSync('xguserinfo',res.data.data.userinfo)
				}
			})
		}
	}
</script>

<style lang="scss">
.userinfo{
	background-color: #f9f9f9;
	padding: 36rpx;
	&__nickname{
		font-family: PingFang-SC, PingFang-SC;
		font-weight: 800;
		font-size: 43rpx;
		color: #000000;
		line-height: 43rpx;
		margin: 20rpx 0 40rpx;
	}
	&__school{
		font-family: PingFang-SC, PingFang-SC;
		font-weight: 500;
		font-size: 27rpx;
		color: #989898;
		line-height: 26rpx;
	}
	&__tx{
		width: 163rpx;
		height: 163rpx;
		background: #989898;
		border-radius: 50%;
	}
	&__num{
		font-family: PingFang-SC, PingFang-SC;
		font-weight: 800;
		font-size: 36rpx;
		color: #3E3E3E;
		line-height: 27rpx;
	}
	&__txt{
		font-family: PingFang-SC, PingFang-SC;
		font-weight: 500;
		font-size: 23rpx;
		color: #989898;
		line-height: 22rpx;
		margin-top: 22rpx;
	}
}
.con{
	padding: 40rpx 36rpx;
	&__title{
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-family: PingFang-SC, PingFang-SC;
		font-weight: 800;
		font-size: 26rpx;
		color: #424242;
		line-height: 26rpx;
		&__icon{
			width: 30rpx;
			height: 30rpx;
		}
	}
}
.empbtn{
	font-family: PingFang-SC, PingFang-SC;
	font-weight: 800;
	font-size: 27rpx;
	color: #6286D7;
	line-height: 27rpx;
	margin-top: 40rpx;
}
</style>
